import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

Item {
    id: parameterKnifeBack
    width: 1820
    height: 910

    // Rectangle{
    //     anchors.fill: parent
    //     color: "blue"

    //     Text{
    //         anchors.centerIn: parent
    //         font.pixelSize: 50
    //         font.bold: true
    //         color: "white"
    //         text: qsTr("刀具参数")
    //     }
    // }


    property real labelFontSize: 20
    property string rowColor_Light : "white"
    property string rowColor_Deep: "#D3D3D3"

    Row{
        anchors.top: parameterKnifeBack.top
        anchors.left: parameterKnifeBack.left
        // anchors.leftMargin: 400
        spacing: 1

        Repeater{
            model: 6

            Rectangle{
                width: 1820/6
                height: 40
                color: "#333333"

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: labelFontSize
                    color: "white"
                    text: index === 0 ? qsTr("名 称")
                        : index === 1 ? qsTr("钻铣上主轴")
                        : index === 2 ? qsTr("钻铣位置反馈")
                        : index === 3 ? qsTr("名 称")
                        : index === 4 ? qsTr("钻铣后主轴")
                        :               qsTr("钻铣位置反馈")


                }
            }
        }
    }

    Rectangle{
        anchors.top: parameterKnifeBack.top
        anchors.topMargin: 40
        anchors.left: parameterKnifeBack.left
        width: 1820
        height: 870
        color: "transparent"
        clip: true

        // 1. 核心滚动容器：Flickable（直接支持boundsBehavior）
        Flickable {
            id: flick
            anchors.fill: parent
            flickableDirection: Flickable.VerticalFlick // 关闭水平滚动（内容宽度与容器一致）
            boundsBehavior: Flickable.StopAtBounds // 关键：滚动到边界后停止，无弹性
            contentWidth: parent.width  // 宽度固定为容器宽 // 内容区域（与之前的Column一致）

            Column {
                id: contentColumn
                width: flick.width
                spacing: 1

                Row {           // 第一行 数据
                    width: parent.width
                    height: 40
                    spacing: 1

                    Rectangle{
                        width: 1820/6
                        height: 40
                        border.width: 1
                        border.color: "white"
                        // color: "transparent"
                        color: rowColor_Light
                        // 数据字段（与标题对应）
                        Text {
                            font.pixelSize: labelFontSize
                            horizontalAlignment: Text.AlignCenter
                            verticalAlignment: Text.AlignVCenter
                            anchors.centerIn: parent
                            // color: "white"
                            text: qsTr("上料变频器启停时间")
                        }
                    }

                    Rectangle{
                        width: 1820/6
                        height: 40
                        border.width: 1
                        color: rowColor_Light

                        A_Input{
                            inputWidth: parent.width
                            onEditingFinished: function(finalValue) {
                                console.log(finalValue)
                            }
                        }

                    }

                    Rectangle{
                        width: 1820/6
                        height: 40
                        border.width: 1
                        border.color: "white"
                        // color: "transparent"
                        color: rowColor_Light
                        // 数据字段（与标题对应）
                        Text {
                            font.pixelSize: labelFontSize
                            horizontalAlignment: Text.AlignCenter
                            verticalAlignment: Text.AlignVCenter
                            anchors.centerIn: parent
                            // color: "white"
                            text: qsTr("测试反馈值")
                        }
                    }

                    Rectangle{
                        width: 1820/6
                        height: 40
                        border.width: 1
                        border.color: "white"
                        // color: "transparent"
                        color: rowColor_Light

                        Text {
                            font.pixelSize: labelFontSize
                            horizontalAlignment: Text.AlignCenter
                            verticalAlignment: Text.AlignVCenter
                            anchors.centerIn: parent
                            // color: "white"
                            text: qsTr("钻铣变频器启停时间")
                        }

                    }
                    Rectangle{
                        width: 1820/6
                        height: 40
                        border.width: 1
                        color: rowColor_Light

                        A_Input{
                            inputWidth: parent.width
                            onEditingFinished: function(finalValue) {
                                console.log(finalValue)
                            }
                        }

                    }

                    Rectangle{
                        width: 1820/6
                        height: 40
                        border.width: 1
                        border.color: "white"
                        // color: "transparent"
                        color: rowColor_Light
                        // 数据字段（与标题对应）
                        Text {
                            font.pixelSize: labelFontSize
                            horizontalAlignment: Text.AlignCenter
                            verticalAlignment: Text.AlignVCenter
                            anchors.centerIn: parent
                            // color: "white"
                            text: qsTr("测试反馈值")
                        }
                    }

                }
                Row {           // 第二行 数据
                    width: parent.width
                    height: 40
                    spacing: 1

                    Rectangle{
                        width: 1820/6
                        height: 40
                        border.width: 1
                        border.color: "white"
                        // color: "transparent"
                        color: rowColor_Deep
                        // 数据字段（与标题对应）
                        Text {
                            font.pixelSize: labelFontSize
                            horizontalAlignment: Text.AlignCenter
                            verticalAlignment: Text.AlignVCenter
                            anchors.centerIn: parent
                            // color: "white"
                            text: qsTr("上料变频器启停时间")
                        }
                    }

                    Rectangle{
                        width: 1820/6
                        height: 40
                        border.width: 1
                        color: rowColor_Deep

                        A_Input{
                            inputWidth: parent.width
                            onEditingFinished: function(finalValue) {
                                console.log(finalValue)
                            }
                        }

                    }

                    Rectangle{
                        width: 1820/6
                        height: 40
                        border.width: 1
                        border.color: "white"
                        // color: "transparent"
                        color: rowColor_Deep
                        // 数据字段（与标题对应）
                        Text {
                            font.pixelSize: labelFontSize
                            horizontalAlignment: Text.AlignCenter
                            verticalAlignment: Text.AlignVCenter
                            anchors.centerIn: parent
                            // color: "white"
                            text: qsTr("测试反馈值")
                        }
                    }

                    Rectangle{
                        width: 1820/6
                        height: 40
                        border.width: 1
                        border.color: "white"
                        // color: "transparent"
                        color: rowColor_Deep

                        Text {
                            font.pixelSize: labelFontSize
                            horizontalAlignment: Text.AlignCenter
                            verticalAlignment: Text.AlignVCenter
                            anchors.centerIn: parent
                            // color: "white"
                            text: qsTr("钻铣变频器启停时间")
                        }

                    }

                    Rectangle{
                        width: 1820/6
                        height: 40
                        border.width: 1
                        color: rowColor_Deep

                        A_Input{
                            inputWidth: parent.width
                            onEditingFinished: function(finalValue) {
                                console.log(finalValue)
                            }
                        }

                    }

                    Rectangle{
                        width: 1820/6
                        height: 40
                        border.width: 1
                        border.color: "white"
                        // color: "transparent"
                        color: rowColor_Deep
                        // 数据字段（与标题对应）
                        Text {
                            font.pixelSize: labelFontSize
                            horizontalAlignment: Text.AlignCenter
                            verticalAlignment: Text.AlignVCenter
                            anchors.centerIn: parent
                            // color: "white"
                            text: qsTr("测试反馈值")
                        }
                    }
                }

            }
        }


    }



}
